<template>
  <!-- 顶部通栏 -->
  <AppNavBar />
  <!-- 头部组件 -->
  <AppHeader />
  <!-- 吸顶组件 -->
  <AppHeaderSticky />
  <!-- 内容容器 -->
  <div class="app-body">
    <!-- 二级路由 -->
    <RouterView />
  </div>
  <!-- 底部组件 -->
  <AppFooter />
</template>

<script>
import AppNavBar from "@/components/app-navbar.vue";
import AppHeader from "@/components/app-header";
import AppFooter from "@/components/app-footer.vue";
import AppHeaderSticky from '@/components/app-header-sticky.vue'

import { useStore } from "vuex";
export default {
  name: "Layout",
  components: {
    AppNavBar,
    AppHeader,
    AppFooter,
    AppHeaderSticky,
  },
  // 获取分类数据
  setup() {
    const store = useStore();
    store.dispatch('category/getList')
  },
};
</script>

<style lang="less" scoped>
.app-body {
  min-height: 600px;
}
</style>
